package cn.pli.bike.model.InterfaceService;

import com.tencent.mm.opensdk.modelpay.PayReq;

import java.util.List;
import java.util.Map;

import cn.pli.bike.bean.AnnouncementBean;
import cn.pli.bike.bean.BadErrBean;
import cn.pli.bike.bean.BikeCoordinateBean;
import cn.pli.bike.bean.CheckUpdateBean;
import cn.pli.bike.bean.CouponBean;
import cn.pli.bike.bean.CreditRecord;
import cn.pli.bike.bean.DepositBean;
import cn.pli.bike.bean.ExpensesRecordBean;
import cn.pli.bike.bean.HttpResult;
import cn.pli.bike.bean.IllegalPakingBean;
import cn.pli.bike.bean.LockBean;
import cn.pli.bike.bean.OpenLockBean;
import cn.pli.bike.bean.OpenOrderBean;
import cn.pli.bike.bean.OrderinfoBean;
import cn.pli.bike.bean.PrepaidRecord;
import cn.pli.bike.bean.ProblemBean;
import cn.pli.bike.bean.SettingBean;
import cn.pli.bike.bean.ShareBean;
import cn.pli.bike.bean.UserBean;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * @author zl
 * @date 2017/9/13
 */

public interface UserCreateService {
    /**
     * 获取app启动页图片
     *
     * @return
     */
    @GET("khBike.do?getStartPage")
    Observable<HttpResult<List<String>>> getStartPage();

    /**
     * 获取手机验证码
     *
     * @param mobile
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?getVerifyCode")
    Observable<HttpResult<String>> postVerifyCode(@Field("mobile") String mobile);

    /**
     * 获取韩国验证码
     *
     * @param mobile
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?getKrVerifyCode")
    Observable<HttpResult<String>> postKrVerifyCode(@Field("mobile") String mobile);


    /**
     * 注册或登录
     *
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?signupOrLogin")
    Observable<HttpResult<UserBean>> postSignupOrLogin(@Field("mobile") String mobile, @Field("verifyCode") String verifyCode,@Field("longitude") String longitude, @Field("latitude") String latitude);

    /**
     * touken登录
     * ls
     *
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?loginByToken")
    Observable<HttpResult<UserBean>> postloginByToken(@Field("token") String token);


    /**
     * 上传图片
     *
     * @param picture
     * @return
     */
    @POST("khBike.do?uploadImage")
    Observable<HttpResult<String>> uploadImage(@Body RequestBody picture);

    /**
     * 修改昵称
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?editNickname")
    Observable<HttpResult<String>> editNickname(@Field("nickName") String nickName);


    /**
     * 打开故障上报页面,查询故障类型
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?goFaultReport")
    Observable<HttpResult<List<BadErrBean>>> goFaultReport(@Field("Report") String goFaultReport);


    /**
     * 故障提交
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?faultReport")
    Observable<HttpResult<String>> faultReport(@FieldMap() Map<String, String> map);

    /**
     * 常见问题
     *
     * @param
     * @return
     */
    @GET("khBike.do?commonProblem")
    Observable<HttpResult<List<ProblemBean>>> commonProblem();

    /**
     * 查询违停类型
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?goIllegalParking")
    Observable<HttpResult<List<BadErrBean>>> goIllegalParking(@Field("Report") String goFaultReport);

    /**
     * 违停上报提交
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?illegalParking")
    Observable<HttpResult<String>> illegalParking(@FieldMap() Map<String, String> map);

    /**
     * 违停上报提交
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?getPrepaidRecord")
    Observable<HttpResult<List<PrepaidRecord>>> getPrepaidRecord(@Field("af") String goFaultReport);

    /**
     * 获取用户消费记录（我的行程）
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?getExpensesRecord")
    Observable<HttpResult<List<ExpensesRecordBean>>> getExpensesRecord(@Field("sa") String goFaultReport);

    /**
     * 获取用户信用积分记录
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?getCreditRecord")
    Observable<HttpResult<List<CreditRecord>>> getCreditRecord(@Field("afadf") String goFaultReport);

    /**
     * 获取系统公告列表
     *
     * @param
     * @return
     */

    @GET("khBike.do?getAnnouncement")
    Observable<HttpResult<List<AnnouncementBean>>> getAnnouncement();


    /**
     * 上传用户头像
     *
     * @param picture
     * @return
     */
    @POST("khBike.do?uploadUserPhoto")
    Observable<HttpResult<String>> uploadUserPhoto(@Body RequestBody picture);

    /**
     * 请求支付宝参数
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("aliPayOrder/aliPay.do")
    Observable<HttpResult<OrderinfoBean>> aliPay(@Field("cashnum") double cashnum, @Field("consumptionType") String consumptionType);


    /**
     * 请求支付宝参数
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("wxPayOrder/wxPay.do")
    Observable<HttpResult<String>> wxPay(@Field("cashnum") double cashnum, @Field("consumptionType") String consumptionType);


    /**
     * 根据坐标获取周围单车
     *
     * @param map
     * @return
     */
    @GET("khBike.do?findBikeByCoordinate")
    Observable<HttpResult<List<BikeCoordinateBean>>> findBikeByCoordinate(@QueryMap Map<String, Double> map);


    /**
     * 扫码开锁
     *
     * @param map
     * @return
     */
    @GET("OpenLockController.do?saomakaisuo")
    Observable<HttpResult<OpenLockBean>> openLockScan(@QueryMap Map<String, String> map);

    /**
     * 根据极光推送的订单id上传关锁位置坐标
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?closeLock")
    Observable<HttpResult<ExpensesRecordBean>> closeLock(@Field("orderId") String orderId, @Field("endLongitude") String endLongitude, @Field("endLatitude") String endLatitude);

    /**
     * 获取押金，联系电话
     *
     * @param
     * @return
     */
    @GET("khBike.do?getDeposit")
    Observable<HttpResult<DepositBean>> getDeposit();

    /**
     * 用户实名认证
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("khBike.do?cardCheckIDCard")
    Observable<HttpResult<String>> cardCheckIDCard(@Field("realname") String realname, @Field("idcard") String idcard);

    /**
     * 退押金
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("aliPayOrder/appPay/refund.do")
    Observable<HttpResult<String>> refundMoney(@Field("realname") String realname);

    /**
     * 获取押金，联系电话
     *
     * @param
     * @return
     */
    @GET("khBike.do?appSettings")
    Observable<HttpResult<List<SettingBean>>> appSettings();

    /**
     * 获取押金，联系电话
     *
     * @param
     * @return
     */
    @GET("khBike.do?checkUpdate")
    Observable<HttpResult<CheckUpdateBean>> checkUpdate();

    /**
     * 获取押金，联系电话
     *
     * @param
     * @return
     */
    @GET("khBike.do?selectOpenOrder")
    Observable<HttpResult<OpenOrderBean>> selectOpenOrder();

    /**
     * 获取用户所有优惠券
     *
     * @param
     * @return
     */
    @GET("khBike.do?getCoupon")
    Observable<HttpResult<List<CouponBean>>> getCoupon();

    /**
     * 获取分享属性
     *
     * @param
     * @return
     */
    @GET("khBike.do?getShareAttribute")
    Observable<HttpResult<ShareBean>> getShareAttribute();


    /**
     * 退押金
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("OpenLockController.do?getLockByLocknum")
    Observable<HttpResult<LockBean>> getLockByLocknum(@Field("locknum") String locknum);

    /**
     * 退押金
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("OpenLockController.do?blueOpenNotice")
    Observable<HttpResult<List<String>>> blueOpenNotice(@Field("locknum") String locknum, @Field("beginLongitude") String beginLongitude, @Field("beginLatitude") String beginLatitude);


    /**
     * 退押金
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("OpenLockController.do?notice")
    Observable<HttpResult<String>> notice(@Field("imei") String imei, @Field("status") String status, @Field("lockStatus") String lockStatus);


}
